package javacafe.action.seminar;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import javacafe.action.Action;
import javacafe.action.ActionForward;
import javacafe.dto.event.SeminarDTO;
import javacafe.serviceimple.SeminarServiceImple;

public class DeleteSeminarAction implements Action {

	@Override
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) {
		
		ActionForward actfoward = new ActionForward();
		SeminarServiceImple schservice = SeminarServiceImple.getInstance();
		SeminarDTO scdto = new SeminarDTO();
		
		String seminar_no = request.getParameter("seminar_no").trim();
		scdto.setSeminar_no(Integer.parseInt(seminar_no));
		
		schservice.deleteSeminar(scdto);

		List<SeminarDTO> lists = schservice.getAllSeminar();
		
		request.setAttribute("sLists", lists);
		actfoward.setUrl("mycalendar");
		return actfoward;
	}

}
